import time
#from pyb import I2C
from machine import Pin, I2C

SLAVE_ADDRESS = 0x42
BAUDRATE = 100000

#i2c_master = I2C(1, I2C.MASTER, baudrate=BAUDRATE)
i2c_master = I2C(1, scl=Pin(5), sda=Pin(4), freq=BAUDRATE)
i2c_master.scan()

for i in range(10):
    i2c_master.send(b"%04i" % i, addr=SLAVE_ADDRESS)
    time.sleep(0.5)